<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/pointer-lock/pointer-lock-test-harness.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
  promise_test(() => {
    return new Promise((resolve, reject) => {
      window.addEventListener('message', (event) => {
        if (event.data == "inner-iframe.html onpointerlockerror") {
          resolve();
        } else {
          reject(event.data);
        }
      });
      function onIframeLoaded() {
        clickOnElement(iframe);
      }
      var iframe = document.createElement('iframe');
      iframe.sandbox = 'allow-scripts';
      iframe.onload = onIframeLoaded;
      iframe.src = '../resources/pointer-lock/inner-iframe.html';
      document.body.appendChild(iframe);
    });
  }, 'Test sandboxed iframe with allow-pointer-lock allows pointer lock.');
</script>
</body>
</html>
